Skip to content

feat: mark background session completions as unread - #89

Merged
johnnyhuy merged 1 commit into
mainfrom
agent/issue-88-unread-completions
Nov 16, 2026
Merged

johnnyhuy merged 1 commit into
mainfrom
agent/issue-88-unread-completions

Conversation

@johnnyhuy

@johnnyhuy johnnyhuy commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Open sessions now marks unread activity when a turn finishes or Pi exits while its transcript is out of view. Opening that session clears its marker across root, view and tab switches; duplicate end and exit events stay acknowledged.

Part of #1. Closes #88.

Verified with the repository's pinned Node 22 toolchain.

  • bun install --frozen-lockfile passed.
  • bun run lint passed.
  • bun run typecheck passed.
  • bun run test:unit passed, 114 tests.
  • mise exec -- bun run test:integration passed, 121 tests.
  • mise run build passed, including lint, typecheck, unit/component tests and bundling.
  • git diff --check passed.
  • Hosted CI passed lint, typecheck, 114 unit tests, 121 component tests, build and the release adapter checks.
  • Hosted mise run test:e2e passed all 74 Electron tests.

The seven new component cases cover shared-root tab acknowledgement, cross-root completion, same-root background completion and exit, visible completion and exit, and duplicate or unknown exit events. The two new Electron cases verify native desktop and minimum window sizes, keyboard acknowledgement without another prompt, and a background runtime exit.

✓ tests/e2e/session-activity.test.ts (2 tests)
  ✓ marks a completion in another root and acknowledges it on opening at native window sizes
  ✓ marks a runtime exit while Changes is open and preserves the exited transcript on acknowledgement
Test Files  9 passed (9)
     Tests  74 passed (74)

Download the uploaded screenshot proof. The artefact contains these PNGs under Users/runner/work/pidex/pidex/test-results/session-activity/, captured from real Electron windows with a temporary Git workspace and deterministic Pi RPC fixture. The test also writes the captures to .tmp/proof/; captures are not committed.

  • background-completion.png shows the unread API result while the web root is selected.
  • background-completion-minimum.png shows the marker at the native minimum window size.
  • acknowledged-completion.png and acknowledged-completion-minimum.png show the opened session after acknowledgement.
  • background-exit.png shows unread activity after the fixture runtime exits while Changes is open.

Local bun run test:e2e tests/e2e/session-activity.test.ts was blocked before app launch by Electron failed to install correctly. Hosted Electron capture and artefact upload succeeded. Inline screenshot attachment was blocked because the browser access host is unavailable, so the PNGs are linked through the uploaded CI artefact above.

Unread state is held in memory for this window and resets on quit. A transcript already selected in this window is considered read, regardless of OS window focus. Notifications and persisted unread state remain follow-up work.

Co-authored-by: OpenAI Codex <noreply@openai.com>
@johnnyhuy
johnnyhuy marked this pull request as ready for review November 16, 2026 15:42
@johnnyhuy
johnnyhuy merged commit bf44c21 into main Nov 16, 2026
16 checks passed
@johnnyhuy
johnnyhuy deleted the agent/issue-88-unread-completions branch November 16, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mark background session completions as unread in Open sessions

1 participant